﻿@model IEnumerable<vngoodlife.Related_Article>
@foreach (var item in Model)
{
    @Ajax.ActionLink("X", "DeleteRelatedArticle", "Article",
            new { articleID = ViewBag.artid, relatedArticleID = (item.RelatedArticleID == ViewBag.artid) ? item.ArticleID : item.RelatedArticleID },
                    new AjaxOptions
                    {
                        UpdateTargetId = "relatedArticleDisplay",
                        HttpMethod = "GET",
                        InsertionMode = InsertionMode.Replace,
                        LoadingElementId = "progress_related",
                        LoadingElementDuration = 2000,
                        OnSuccess = "ClearValueRelate"
                    })       
    if (ViewBag.artid == item.ArticleID)
    {
        <label>@item.RelatedArticle.Title</label> <br />
    }
    else { 
        <label>@item.Article.Title</label> <br />
    }
}